package com.ruoyi.web.controller.index;

import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.FApplys;
import com.ruoyi.system.domain.FXingZhengGongKai;
import com.ruoyi.system.domain.FXingZhengGuiFan;
import com.ruoyi.system.domain.GuiZhang;
import com.ruoyi.web.service.ManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@Controller
@RequestMapping("/api/user")
@RestController
public class ManagerController {
	@Autowired
	private ManagerService userService;
	// 规章列表
	@Anonymous
	@PostMapping(path = "/guizhang_list")
	public AjaxResult guizhangCreate(@RequestBody GuiZhang guiZhang) {
		return userService.guizhangCreate(guiZhang);
	}
	
	@Anonymous
	@GetMapping(path = "/guizhang_list")
	public AjaxResult guizhangList(@RequestParam Map<String, Object> params) {
		return userService.guizhangList(params);
	}
	
	@Anonymous
	@GetMapping(path = "/guizhang_detail/{id}")
	public AjaxResult guizhangDetail(@PathVariable("id") Integer id) {
		return userService.guizhangDetail(id);
	}
	
	@Anonymous
	@DeleteMapping(path = "/guizhang_del/{id}")
	public AjaxResult guizhangDelete(@PathVariable("id") Integer id) {
		return userService.guizhangDelete(id);
	}
	
	// 行政规范
	@Anonymous
	@PostMapping(path = "/xing_zheng_gui_fan_list")
	public AjaxResult xingzhengguifanCreate(@RequestBody FXingZhengGuiFan fXingZhengGuiFan) {
		return userService.xing_zheng_gui_fan_create(fXingZhengGuiFan);
	}
	@Anonymous
	@GetMapping(path = "/xing_zheng_gui_fan_list")
	public AjaxResult xingzhengguifanList(@RequestParam Map<String, Object> params) {
		return userService.xing_zheng_gui_fan_list(params);
	}
	
	@Anonymous
	@GetMapping(path = "/xing_zheng_gui_fan_detail/{id}")
	public AjaxResult xingzhengguifanDetail(@PathVariable("id") Integer id) {
		return userService.xing_zheng_gui_fan_detail(id);
	}
	
	@Anonymous
	@DeleteMapping(path = "/xing_zheng_gui_fan_del/{id}")
	public AjaxResult xingzhengguifanDelete(@PathVariable("id") Integer id) {
		return userService.xing_zheng_gui_fan_delete(id);
	}
	
	
	// 行政公开
	@Anonymous
	@PostMapping(path = "/xing_zheng_gong_kai_list")
	public AjaxResult xingzhenggongkaiCreate(@RequestBody FXingZhengGongKai fXingZhengGongKai) {
		return userService.xing_zheng_gong_kai_create(fXingZhengGongKai);
	}
	
	@Anonymous
	@GetMapping(path = "/xing_zheng_gong_kai_list")
	public AjaxResult xingzhenggongkaiList(@RequestParam Map<String, Object> params) {
		return userService.xing_zheng_gong_kai_list(params);
	}
	
	@Anonymous
	@GetMapping(path = "/xing_zheng_gong_kai_detail/{id}")
	public AjaxResult xingzhenggongkaiDetail(@PathVariable("id") Integer id) {
		return userService.xing_zheng_gong_kai_detail(id);
	}
	
	@Anonymous
	@DeleteMapping(path = "/xing_zheng_gong_kai_del/{id}")
	public AjaxResult xingzhenggongkaiDelete(@PathVariable("id") Integer id) {
		return userService.xing_zheng_gong_kai_delete(id);
	}
	
	
	@Anonymous
	@PostMapping(path = "/apply")
	public AjaxResult applyCreate(@RequestBody FApplys fApplys) {
		return userService.applyCreate(fApplys);
	}
	
	@Anonymous
	@GetMapping(path = "/apply")
	public AjaxResult applyCreate(@RequestParam Map<String, Object> params) {
		return userService.applyList(params);
	}
	
	@Anonymous
	@PutMapping(path = "/apply")
	public AjaxResult applyUpdate(@RequestBody Map<String, Object> params) {
		return userService.applyUpdate(params);
	}
	
	@Anonymous
	@PutMapping(path = "/apply/all")
	public AjaxResult applyUpdate(@RequestBody FApplys fApplys) {
		return userService.applyUpdate(fApplys);
	}
	
	@Anonymous
	@GetMapping(path = "/area")
	public AjaxResult area() {
		return userService.areaList();
	}
}
